package com.sniff.atp.exception;

import com.sniff.atp.exception.enums.ErrorEnum;

public class BussinessException extends RuntimeException {
    private final Integer code;
    private final String msg;

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public BussinessException(String message) {
        super(message);
        this.code = 9999;
        this.msg = message;
    }

    public BussinessException(ErrorEnum errorEnum) {
        super(errorEnum.getCode() + " " + errorEnum.getMsg());
        this.code = errorEnum.getCode();
        this.msg = errorEnum.getMsg();
    }
}
